package com.ctlele.team.space.activity;

import android.content.Context;
import android.os.Bundle;
import android.transition.Fade;
import android.view.Window;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public abstract class BaseActivity extends AppCompatActivity {

    private Context mContext;

    protected abstract int initLayout();

    protected abstract void initView();

    protected abstract void initData();

    protected Context getContext() {
        return mContext;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setActivityChangeAnimation();
        mContext = this;
        setContentView(initLayout());
        initView();
        initData();
    }

    private void setActivityChangeAnimation() {
        getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
        getWindow().setEnterTransition(new Fade());
        getWindow().setExitTransition(new Fade());
    }
}
